<?php

/**
 * alertamaleza form base class.
 *
 * @method alertamaleza getObject() Returns the current form's model object
 *
 * @package    plagas
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasealertamalezaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'monitoreo_id'     => new sfWidgetFormInputHidden(),
      'ciclo_id'         => new sfWidgetFormInputHidden(),
      'IPA'              => new sfWidgetFormInputText(),
      'especiedominante' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('maleza'), 'add_empty' => true)),
      'IPEF'             => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'monitoreo_id'     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('monitoreo_id')), 'empty_value' => $this->getObject()->get('monitoreo_id'), 'required' => false)),
      'ciclo_id'         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('ciclo_id')), 'empty_value' => $this->getObject()->get('ciclo_id'), 'required' => false)),
      'IPA'              => new sfValidatorInteger(),
      'especiedominante' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('maleza'), 'required' => false)),
      'IPEF'             => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('alertamaleza[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'alertamaleza';
  }

}
